#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

char g[13][13];
int a, b, c, d;


int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    for(int i = 1; i <= 10; i ++){
        cin >> g[i] + 1;
    }

    
    for(int i = 1; i <= 10; i ++){
        for(int j = 1; j <= 10; j ++){
            if(g[i][j] == '#'){
                a = i, c = j;
                b = a, d = c;
                while(g[a][d] == '#'){
                    d ++;
                }

                d --;

                while(g[b][c] == '#'){
                    b ++;
                }

                b--;

                cout << a << " " << b << '\n' << c << " " << d << "\n";
                return 0;
            }
        }
    }

    return 0;
}